package com.yksj.healthtalk.entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import org.json.JSONArray;
import org.json.JSONObject;

public class DoctorGroupMemberEntity implements Serializable{
		private String Userid;//
		private String BlientIconBackground;//头像路径
		private String addTime;//特殊收费人群添加时间"
		private String servicePriceDefine;//服务定义价格
		private String remarksName;//备注名
		private String customerAccounts; // --客户帐号
		private String customerNickname; // --客户昵称
		public String getUserid() {
			return Userid;
		}
		public void setUserid(String userid) {
			Userid = userid;
		}
		public String getBlientIconBackground() {
			return BlientIconBackground;
		}
		public void setBlientIconBackground(String blientIconBackground) {
			BlientIconBackground = blientIconBackground;
		}
		public String getAddTime() {
			return addTime;
		}
		public void setAddTime(String addTime) {
			this.addTime = addTime;
		}
		public String getServicePriceDefine() {
			return servicePriceDefine;
		}
		public void setServicePriceDefine(String servicePriceDefine) {
			this.servicePriceDefine = servicePriceDefine;
		}
		public String getRemarksName() {
			return remarksName;
		}
		public void setRemarksName(String remarksName) {
			this.remarksName = remarksName;
		}
		public String getCustomerAccounts() {
			return customerAccounts;
		}
		public void setCustomerAccounts(String customerAccounts) {
			this.customerAccounts = customerAccounts;
		}
		public String getCustomerNickname() {
			if(remarksName==null&&"".equals(remarksName)){
				return customerNickname;
			}else{
				return remarksName;
			}
			
		}
		public void setCustomerNickname(String customerNickname) {
			this.customerNickname = customerNickname;
		}
		public DoctorGroupMemberEntity() {
			super();
		}
		public DoctorGroupMemberEntity(String userid, String blientIconBackground,
				String addTime, String servicePriceDefine, String remarksName,
				String customerAccounts, String customerNickname) {
			super();
			Userid = userid;
			BlientIconBackground = blientIconBackground;
			this.addTime = addTime;
			this.servicePriceDefine = servicePriceDefine;
			this.remarksName = remarksName;
			this.customerAccounts = customerAccounts;
			this.customerNickname = customerNickname;
		}
		
		public static List<DoctorGroupMemberEntity> parseToList(String content){
			List<DoctorGroupMemberEntity> lists=new ArrayList<DoctorGroupMemberEntity>();
			try {
				org.json.JSONArray objects=new JSONArray(content);
				for (int i = 0; i < objects.length(); i++) {
					JSONObject object=(JSONObject) objects.get(i);
					DoctorGroupMemberEntity entity=new DoctorGroupMemberEntity(object.optString("customerId"), object.optString("clientIconBackground"),  object.optString("addTime"), object.optString("servicePriceDefine"), object.optString("remarksName"),object.optString("customerAccounts"),object.optString("customerNickname"));
					lists.add(entity);
				}
				return lists;
			} catch (Exception e) {
				return null;
			}
		}
	} 
	